var http = require('./httputils'); //相对路径
var up = require("./uputils")
var httpFrom = require('./httpFrom'); //相对路径
var config = require("./config")
const server = {
  //账号密码登录
  authenticate: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/authenticate", params, onSuccess, onFailed)
  },
  //微信登录
  weChatLogin: function (params, onSuccess, onFailed) {
    httpFrom.postRequest(config.url + "/api/wechatLogin", params, onSuccess, onFailed)
  },
  //绑定微信信息
  wechatBindInfo: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/wechatBindInfo", params, onSuccess, onFailed)
  },
  //绑定手机号
  wechatBindPhone: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/wechatBindPhone", params, onSuccess, onFailed)
  },
  //设置昵称
  changeUsername: function (params, onSuccess, onFailed) {
    httpFrom.putRequest(config.url + "/api/user/changeUsername", params, onSuccess, onFailed)
  },
  //绑定个手机号
  weChatUpdatePhone: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/user/weChatUpdatePhone", params, onSuccess, onFailed)
  },
  //获取岗位列表
  getJob: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/jobInProgress", params, onSuccess, onFailed)
  },
  //上传文件
  upDataFile: function (params, onSuccess, onFailed) {

    up.upRequest(config.url + "/api/upload/file", params, onSuccess, onFailed)
  },
  //新建岗位
  addfactoryJob: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/createPost", params, onSuccess, onFailed)
  },
  // 获取用户信息
  userInfo: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/user", params, onSuccess, onFailed)
  },
  //获取公司信息
  getComInfo: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/companyInfo", params, onSuccess, onFailed)
  },
  //删除合作公司
  deleteTeam: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/deleteTeam/" + params, params, onSuccess, onFailed)
  },
  //绑定银行卡
  bankCard: function (params, onSuccess, onFailed) {
    httpFrom.putRequest(config.url + "/api/user/bankCard", params, onSuccess, onFailed)
  },
  //暂停招聘
  ztfactoryJobId: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/pauseJoin/" + id, {}, onSuccess, onFailed)
  },
  //开启招聘
  kqfactoryJobId: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/startJoin/" + id, {}, onSuccess, onFailed)
  },
  //获取附近的位置
  jobnearby: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/nearby", params, onSuccess, onFailed)
  },
  //获取岗位人员信息
  applicantInPostId: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/applicantInPostId", params, onSuccess, onFailed)
  },
  //结算审核
  updateFJStatus: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/updateFJStatus/" + data, {}, onSuccess, onFailed)
  },
  //录用
  updateHireStatus: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/updateHireStatus/" + data, {}, onSuccess, onFailed)
  },
  //地址列表
  getAddressList: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/addressList", {}, onSuccess, onFailed)
  },
  //删除地址
  deleteAddress: function (id, onSuccess, onFailed) {
    http.deleteRequest(config.url + "/api/deleteAddress/" + id, {}, onSuccess, onFailed)
  },
  //添加地址
  addAddress: function (data, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/addAddress", data, onSuccess, onFailed)
  },
  //岗位详情
  getJobData: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/searchJob/" + id, {}, onSuccess, onFailed)
  },
  //修改岗位信息
  updatePost: function (data, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/updatePost/" + data.id, data, onSuccess, onFailed)
  },
  //取消收藏
  job_favoriteD: function (id, onSuccess, onFailed) {
    http.deleteRequest(config.url + "/api/user/job_favorite/" + id, {}, onSuccess, onFailed)
  },
  //岗位列表
  getjob_favorite: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/user/job_favorite", params, onSuccess, onFailed)
  },
  //报名岗位
  registration: function (id, data, onSuccess, onFailed) {
    httpFrom.postRequest(config.url + "/api/job/registration/" + id, data, onSuccess, onFailed)
  },
  //取消报名
  registrationD: function (id, onSuccess, onFailed) {
    http.deleteRequest(config.url + "/api/job/registration/" + id, {}, onSuccess, onFailed)
  },
  //报名列表
  getregistration: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/registration", params, onSuccess, onFailed)
  },

  getregistration1: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/registration?" + params, {}, onSuccess, onFailed)
  },
  //录用列表
  gethire: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/hire", params, onSuccess, onFailed)
  },
  //getmargin
  getmargin: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/margin", params, onSuccess, onFailed)
  },
  //获取招聘合计
  getsalarySum: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/totalNum", params, onSuccess, onFailed)
  },
  //获取工作收益
  getworkList: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/salary/work", params, onSuccess, onFailed)
  },
  // 获取推荐收益
  getinviteList: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/salary/invite", params, onSuccess, onFailed)
  },
  //### 获取当前用户邀请记录
  getinvite: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/user/invite", params, onSuccess, onFailed)
  },
  //获取验证码
  getVerificationCode: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/user/getVerificationCode", params, onSuccess, onFailed)
  },
  //修改手机号
  updateTelphone: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/user/updateTelphone", params, onSuccess, onFailed)
  },
  //提交建议反馈
  feedback: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + "/feedback/feedback", params, onSuccess, onFailed)
  },
  //registrationId
  registrationId: function (id, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/job/margin/" + id, {}, onSuccess, onFailed)
  },
  //联系入职
  entryInfo: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/" + id + "/entryInfo", {}, onSuccess, onFailed)
  },
  //取消保证金
  marginIdD: function (id, onSuccess, onFailed) {
    http.deleteRequest(config.url + "/api/job/margin/" + id, {}, onSuccess, onFailed)
  },
  //打卡列表
  getclockInList: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/clockRecord/" + data.factoryJobId + "/" + data.userId, {}, onSuccess, onFailed)
  },
  //新增公司
  addCompanyOperation: function (data, onSuccess, onFailed) {
    http.putRequest(config.url + "/api/company/operation", data, onSuccess, onFailed)
  },
  // 公司信息新增以及修改
  companyOperation: function (data, onSuccess, onFailed) {
    http.putRequest(config.url + "/api/company/update", data, onSuccess, onFailed)
  },
  //新增合作公司
  applyTeam: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/applyTeam/" + data, {}, onSuccess, onFailed)
  },
  //搜索合作公司
  searchCompanyTeam: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/searchCompanyTeam/" + data, {}, onSuccess, onFailed)
  },
  //获取合作公司列表
  getTeamCompanyList: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/teamCompanyList", data, onSuccess, onFailed)
  },
  //上传图片
  uploadFlie: function (params, onSuccess, onFailed) {
    up.upRequest(config.url + "/api/upload/file", params, onSuccess, onFailed)
  },
  //打卡
  clockIn: function (id, data, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/clockIn/" + id, data, onSuccess, onFailed)
  },
  //获取折线图
  getMonthData: function (data, id, onSuccess, onFailed) {
    httpFrom.getRequest(config.url + "/api/echartsCostPerDay", data, onSuccess, onFailed)
  },
  //职位占比
  getechartsPositionOf(data, id, onSuccess, onFailed) {
    httpFrom.getRequest(config.url + "/api/echartsPositionOf", data, onSuccess, onFailed)
  },
  //打卡记录全部数据
  getclockInInfo: function (data, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/clockIn", {}, onSuccess, onFailed)
  },
  //离职
  getclockInInfo: function (id, onSuccess, onFailed) {
    http.postRequest(config.url + "/api/job/registration/leave/" + id, {}, onSuccess, onFailed)
  },
  //获取轮播图
  getcarousel: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/carousel", {}, onSuccess, onFailed)
  },
  //获取全部岗位
  getAllJob: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/job/posts", {}, onSuccess, onFailed)
  },
  //是否已缴费
  getIsPay: function ({ }, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/user/isPay", {}, onSuccess, onFailed)
  },
  // 添加岗位  通知对应员工
  subMsgforCreatePost: function (id, onSuccess, onFailed) {
    http.getRequest(config.ygurl + "/api/user/subMsgforCreatePost/" + id, {}, onSuccess, onFailed)
  },
  // 结算工资 通知对应员工
  subMsgforCloseAccount: function (id, onSuccess, onFailed) {
    http.getRequest(config.ygurl + "/api/user/subMsgforCloseAccount/" + id, {}, onSuccess, onFailed)
  },
  // 结算工资接口
  closeAccount: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/closeAccount/" + id, {}, onSuccess, onFailed)
  },
  // 财务  折线图
  echartsCostPerDay: function (time, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/echartsCostPerDay/" + time, {}, onSuccess, onFailed)
  },
  // 财务  饼图
  echartsPositionOf: function (time, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/echartsPositionOf/" + time, {}, onSuccess, onFailed)
  },
  // 财务  账单详情列表
  billslist: function ({ }, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/bills", {}, onSuccess, onFailed)
  },
  // 财务账单列表详情
  billInfos: function (factoryJobId, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/billInfos/" + factoryJobId, {}, onSuccess, onFailed)
  },
  // 获取微信支付所需参数
  createOrder: function (money, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/wxpay/createOrder/" + money, {}, onSuccess, onFailed)
  },
  // 绑定支付宝账户
  bindAli: function (zh, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/user/bindAliPayAcount/" + zh, {}, onSuccess, onFailed)
  },
  // 获取分享企业状态列表
  extend: function (type, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/user/extend/" + type, {}, onSuccess, onFailed)
  },
  // 获取分享企业端二维码
  getShareCode: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/qrcode/create", params, onSuccess, onFailed)
  },
  //  获取全部企业类别
  getBusiness: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/getBusiness", params, onSuccess, onFailed)
  },
  //  获取退款接口
  backmoney: function (id, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/wxpay/refunds/" + id, {}, onSuccess, onFailed)
  },
  //  获取企业推荐收益
  getRecommendAmountList: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/getRecommendAmountList", params, onSuccess, onFailed)
  },
  statisticsByUserStatus: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/statisticsByUserStatus", params, onSuccess, onFailed)
  },
  // 获取轮播
  carousel: function ({ }, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/carousel/1", {}, onSuccess, onFailed)
  },
  // 获取轮播
  getFloatSalary: function ({ }, onSuccess, onFailed) {
    http.getRequest(config.url + "/api/getFloatSalary", {}, onSuccess, onFailed)
  },
  // 广场资讯列表
  newslist: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/news/list`, params, onSuccess, onFailed)
  },
  // 自己发布资讯列表
  newsmylist: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/news/mylist`, params, onSuccess, onFailed)
  },
  // 发布资讯
  newpub: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/news/save`, params, onSuccess, onFailed)
  },
  // 收藏资讯
  collect: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/news/collect/${params.id}`, {}, onSuccess, onFailed)
  },
  // 收藏者头像列表
  collectList: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/news/collectList/${params.id}`, {}, onSuccess, onFailed)
  },
  // 保存 工作 供需
  postExpressSave: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/save`, params, onSuccess, onFailed)
  },
  // 列表 工作 供需
  postExpressList: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/list`, params, onSuccess, onFailed)
  },
  // 详情 工作 
  postExpressInfo: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/info/${params.id}`, {}, onSuccess, onFailed)
  },
  // 发布数  完成数 工作 
  postExpressTotal: function ({ }, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/totalNo`, {}, onSuccess, onFailed)
  },
  // 报名列表 工作 
  postExpressBm: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/collectList?id=${params.id}`, {}, onSuccess, onFailed)
  },
  // 报名 工作 
  bmCollect: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/collect/${params.id}`, {}, onSuccess, onFailed)
  },
  // 完成 工作 
  postExpressOver: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/complete/${params.id}`, {}, onSuccess, onFailed)
  },
  // 取消报名 工作 
  qxCollect: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/postExpress/cancleCollect/${params.id}`, {}, onSuccess, onFailed)
  },
  // 企业端 生成小程序码
  createNewCode: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + `/api/qrcode/createQrcode2`, params, onSuccess, onFailed)
  },
  // 企业端 生成 用户端小程序码
  customQRCode: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + `/api/qrcode/customQRCode`, params, onSuccess, onFailed)
  },
  // 获取当前用户的素材
  getMediaList: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + `/media-manage/queryPageList/${params.type}/${params.pageNo}/${params.pageSize}`, {}, onSuccess, onFailed)
  },
  // 添加素材
  addMaterial: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/media-manage/saveOrUpdate`, params, onSuccess, onFailed)
  },
  // 删除素材
  delMaterial: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/media-manage/deleteById/${params.id}`, {}, onSuccess, onFailed)
  },
  // 稍后认证  
  laterCertification: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/api/user/laterAuthention`, {}, onSuccess, onFailed)
  },
  // 素材选择  
  chooseMaterial: function (params, onSuccess, onFailed) {
    http.postRequest(config.url + `/media-job/save`, params, onSuccess, onFailed)
  },
  // 获取岗位存在的素材
  getPostMaterial: function (params, onSuccess, onFailed) {
    http.getRequest(config.url + `/media-job/queryMediaByJobId/${params.type}/${params.jobId}`, {}, onSuccess, onFailed)
  },


}
module.exports = {
  http: server,
}